0 CLEAR500:DIMCC,CA,RV,T,M$,MC:MC=16384:RV=64:GOTO60
5 CA=(PEEK(384)AND1)*256+PEEK(385):PRINTM$;:CC=((PEEK(384)AND1)*256+PEEK(385))-1
6 FORT=CA+MCTOCC+MC:POKET,PEEK(T)-RV:NEXT:RETURN
10 REM THE KILLER SATELLITE
20 REM VERSION 1.1
30 REM 15/8/83
40 REM ** BY N. S. EDWARDS **
50 REM INITIAL DISPLAY
60 CLS0:FOR T=1 TO 15:SET(RND(64)-1,RND(32)-1,5):NEXT:PRINT@262,"the"CHR$(128)"killer"CHR$(128)"satellite";
70 PRINT@340,CHR$(249);:PRINT@373,CHR$(175);:PRINT@404,CHR$(246);
80 REM SET UP STRINGS
90 FOR T=1 TO 5:SH$=SH$+CHR$(183)+CHR$(187)+CHR$(128):NEXT
100 FOR T=1 TO 7:B$=B$+CHR$(143+16*T):NEXT
110 PRINT@365,B$;
120 FOR CA=1 TO 2:FOR T=1 TO 8:SOUND50,1:SOUND75,1:NEXT:NEXT
130 CLS:PRINT"A SATELLITE ORBITING FAR ABOVE"
131 PRINT"THE EARTH HAS MALFUNCTIONED."
132 PRINT"IT HAS BEGUN SENDING DANGEROUS"
135 PRINT"COSMIC RAYS TOWARDS THE EARTH."
136 PRINT"YOU MUST PROTECT THE EARTH"
137 PRINT"FROM THE COSMIC RAYS BY MATCHING";
138 PRINT"THE COLOURS OF THE APPROACHING"
140 PRINT"RAYS WITH YOUR SHIELD UNTIL THE"
141 PRINT"SATELLITE RUNS OUT OF POWER"
142 PRINT"(11 ROUNDS).":PRINT
143 PRINT "TO DO THIS USE THE <SPACE BAR>.":PRINT"  BE WARNED THE RAYS TRAVEL AT    EVER INCREASING SPEEDS. "
155 PRINT@484,"PRESS <ENTER> TO BEGIN";
160 T=-1
170 IF INKEY$<>"" THEN200
171 IF T THEN POKE49151,64
172 IF NOT(T) THEN SOUNDRND(10),1
180 T=NOT(T):GOTO 170
190 REM INITIALIZE VARIABLES
200 CLS0:X=270:S=110:SH=3:E=1:S1=0:M=0:R=0
210 GOTO500
220 REM CONTROL LOOP
230 GOSUB 430
240 REM FIND COLOUR MATCH
250 F=0
260 FORJ=1TOLEN(Q$):ON1-(MID$(Q$,J,1)=D$)GOTO261,270
261 NEXT:F=0:GOTO290
270 F=J:A$=LEFT$(A$,J-1)+MID$(A$,J+1)
280 X=X+1:M=M+10:E=E-1
290 Q$=MID$(A$,1,E)
300 REM UPDATE DISPLAY
310 PRINT@X,Q$;:PRINT@463,"";:M$=STR$(M):GOSUB5
320 SOUND100,1
330 REM CHECK FOR WIN
340 IF LEFT$(A$,1)=CHR$(128) THEN M=M+100*R:GOTO 500
350 GOSUB 430
360 REM CHECK FOR LOSS
370 X=X-1:E=E+1:IF X=<259 THEN M=M-400:GOSUB580:GOTO500
380 GOSUB 430
390 GOTO230
400 REM END CONTROL LOOP
410 REM
420 REM CHANGE SHIP COLOUR
430 FOR V=1 TO G
440 IF PEEK(2) AND PEEK(383)=32 THEN C=C+1:IF C>7 THEN C=1
450 D$=CHR$(143+16*C):PRINT@258,D$;
460 FOR I=1 TO SV*1.33:NEXT
470 NEXT V
480 RETURN
490 REM NEXT LEVEL
500 R=R+1:S1=S1+1:IF R>11 THEN 720
501 CLS0:FOR Z=1 TO 10:X1=RND(64)-1:Y1=RND(32)-1:SET(X1,Y1,5):NEXT
510 IF S1>=5 THEN S1=2:SH=SH+1:IF SH>5 THEN SH=5
520 PRINT@244,CHR$(249);:PRINT@277,CHR$(175);:PRINT@308,CHR$(246);
530 PRINT@457,"";:M$="SCORE "+STR$(M):GOSUB5:PRINT@11,"";:M$="ROUND "+STR$(R):GOSUB5:X=275:E=1:S=S-10:A$=""
531 FORT=1TO40:A$=A$+CHR$(RND(7)*16+143):NEXT:A$=A$+"€€€€€€€€€€€€€€€€€€€€"
540 IF R<5 THEN PRINT@480,B$;:G=2:SV=S/2-5:GOTO550
541 G=1:SV=S
550 REM PRINT SHIPS LEFT
560 PRINT@496+(5-SH)*3,LEFT$(SH$,3*SH);:GOTO 230
570 REM SHIP DESTROYED
580 FORZ=1TO10:PRINT@258,CHR$(RND(7)*16+RND(14)+128);:SOUND120-Z*10,1:FORZZ=1TO60:NEXT:NEXT:SH=SH-1:S=S+10:R=R-1:S1=S1-1
590 IF SH<1 THEN 610
591 RETURN
600 REM YOU LOST
610 CLS0:PRINT@96,"all"CHR$(128)"your"CHR$(128)"ships"CHR$(128)"were"CHR$(128)"destroyed";
611 PRINT@128,"before"CHR$(128)"the"CHR$(128);
615 PRINT"satellite"CHR$(128)"ceased"CHR$(128)"to";:PRINT@160,"function";:PRINT@230,"earth"CHR$(128)"was"CHR$(128)"destroyed";
620 A=359
630 REM FINAL SCORE
640 PRINT@A,"your"CHR$(128)"score"CHR$(128);:M$=STR$(M):GOSUB5
650 REM NEXT GAME
660 PRINT@500,"continued";
670 Q$=INKEY$
680 IF INKEY$="" THEN 680
690 CLS0:PRINT@106,"";:M$="ANOTHER GAME?":GOSUB5
700 Q$=INKEY$:IF Q$="" THEN 700
701 IF Q$="Y" THEN 200
702 IF Q$="N" THEN END
703 GOTO700
710 REM YOU'VE WON
720 CLS0:PRINT@170, "congratulations" ;:PRINT@234,"earth"CHR$(128)"was"CHR$(128)"saved";:A=361:GOTO640
